home *** CD-ROM | disk | FTP | other *** search
/ MacWorld: Super Stacks! / Macworld CD.iso / HyperCard Archives / International / French v1.2.5.1 / Piles principales / Notes sur la version 1.2.5 / stack.txt < prev   
Text File  |  1989-10-04  |  8KB  |  272 lines

  1. -- stack: in.5
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 3
  11. -- first background id: 5077
  12. -- card count: 34
  13. -- first card id: 4502
  14. -- list block id: 8435
  15. -- print block id: 3395
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 0
  19. -- free size: 0 bytes
  20. -- total size: 86752 bytes
  21. -- stack block size: 14848 bytes
  22. -- created by hypercard version: 0x00000000
  23. -- compacted by hypercard version: 0x01258000
  24. -- modified by hypercard version: 0x01258000
  25. -- opened by hypercard version: 0x01258000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x8888222288882222
  30. -- patterns[4]: 0x88AA22AA88AA22AA
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68. ‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚ÄîOpen and Close Stack handlers‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî
  69. on startUp
  70.   getHomeInfo
  71.   set userlevel to 5
  72. end startUp
  73.  
  74. on openStack
  75.   if the version < 1.2 then
  76.     answer "Cette pile doit √™tre utilis√©e avec la version 1.2 d'HyperCard."
  77.     set lockMessages to TRUE
  78.     go home
  79.   else
  80.     global userHold,findNextList,pushList
  81.     lock screen
  82.     put the userLevel into userHold
  83.     set userLevel to 5
  84.     put empty into findNextList
  85.     put 0 into pushList
  86.     set loc of msg to 19,285
  87.     unlock screen
  88.   end if
  89. end openStack
  90.  
  91. on closeStack
  92.   global cardName,lastFind,userHold,findNext
  93.   set userLevel to userHold
  94.   --initialise le contenu des variables globales pour r√©cup√©rer l'espace put empty into cardName
  95.   put empty into lastFind
  96.   put empty into userHold
  97.   put empty into findNext
  98.   resetStack
  99.   set lockMessages to FALSE
  100. end closeStack
  101.  
  102. on doMenu command
  103.   if command is "first" or command is "next" or command is "prev" or command is "last" or command is "back" or command is "find..." then
  104.     cancelFindNext
  105.     cancelGoBack
  106.   end if
  107.   pass doMenu
  108. end doMenu
  109.  
  110. on arrowKey
  111.   cancelFindNext
  112.   pass arrowKey
  113. end arrowKey
  114.  
  115. on nextCard
  116.   cancelFindNext
  117.   cancelGoBack
  118.   visual effect scroll left
  119.   go next card
  120. end nextCard
  121.  
  122. on previousCard
  123.   cancelFindNext
  124.   cancelGoBack
  125.   visual effect scroll right
  126.   go previous card
  127. end previousCard
  128.  
  129. on resetStack
  130.   lock screen
  131.   cancelFindNext
  132.   cancelGoBack
  133.   if the number of this card is 1 then
  134.     cleanUpFirstCard
  135.   else
  136.     set lockRecent to TRUE
  137.     go first card
  138.     cleanUpFirstCard
  139.     go back
  140.     set lockRecent to FALSE
  141.   end if
  142. end resetStack
  143.  
  144. on cleanUpFirstCard
  145.   lock screen
  146.   show card field "Commentaires"
  147.   hide button id 8
  148.   hide button id 9
  149.   hide button "Fermer"
  150.   hide card field "Liste compl√©mentaire"
  151.   put empty into card field "Liste compl√©mentaire"
  152.   unlock screen  with barn door close
  153. end cleanUpFirstCard
  154.  
  155. on cancelFindNext
  156.   global findNextList
  157.   hide bg btn "Poursuivre"
  158.   put empty into findNextList
  159. end cancelFindNext
  160.  
  161. on cancelGoBack
  162.   global pushList
  163.   hide bg btn "Retour"
  164.   put 0 into pushList
  165. end cancelGoBack
  166.  
  167. ————————————————————————————————————————————————————————————————————————
  168. Messages et fonctions pour les boutons Chercher... et Poursuivre
  169. ————————————————————————————————————————————————————————————————————————
  170. on myFind
  171.   global lastFind, findNextList
  172.   cancelFindNext
  173.   cancelGoBack
  174.  
  175.   ask "Rechercher dans le champ ""e&"Titre""e&" :" with lastFind
  176.   if it is not empty then
  177.     hide bg btn "Poursuivre"
  178.     set cursor to busy
  179.     lock screen
  180.     put collectAllHits(it, "Titre") into hits
  181.     if hits is empty then
  182.       answer "Texte non trouv√©."
  183.       unlock screen
  184.     else
  185.       put it into lastFind
  186.       get item 1 of hits
  187.       go card it
  188.       if the number of items in hits > 1 then
  189.         put "1," & lastFind & "," & hits into findNextList
  190.         show bg btn "Poursuivre"
  191.       end if
  192.       select empty
  193.       unlock screen
  194.     end if
  195.   end if
  196. end myFind
  197.  
  198. function collectAllHits text, fieldName
  199. repeat with i = 1 to 10000 --nombre arbitraire
  200.   find string text in field fieldName
  201.   if the result is "not found" then
  202.     --texte introuvable
  203.     return empty
  204.   else
  205.     --l'occurence est trouv√©e au moins une fois
  206.     if i = 1 then
  207.       --trouv√© la premi√®re fois
  208.       put the id of this card into firstFind
  209.       put firstFind into result
  210.     else
  211.       --les fois suivantes
  212.       if the id of this card is firstFind then
  213.         --on est revenu √† la premi√®re carte
  214.         return result
  215.       else
  216.         --ajouter une carte au r√©sultat
  217.         put "," & the id of this card after result
  218.       end if
  219.     end if
  220.   end if
  221.   go next card --recherche √† partir de la carte suivante
  222.   set cursor to busy
  223. end repeat
  224. end collectAllHits
  225.  
  226. on findNext
  227.   global findNextList
  228.   lock screen
  229.   put the number of items of findNextList - 2 into max
  230.   put item 1 of findNextList into N
  231.   put item 2 of findNextList into text
  232.   if N = max then
  233.     put 1 into N
  234.   else
  235.     add 1 to N
  236.   end if
  237.   get item N + 2 of findNextList
  238.   hide bg btn "Poursuivre"
  239.   set cursor to watch
  240.   go it
  241.   show bg btn "Poursuivre"
  242.   find string text in field "Titre"
  243.   unlock screen
  244.   put N into item 1 of findNextList
  245. end findNext
  246.  
  247. ‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚ÄîAuxiliary functions‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî
  248. Ces fonctions sont appel√©es par diff√©rents messages dans la pile.
  249. ————————————————————————————————————————————————————————————————————————
  250.  
  251. --la fonction kwote renvoie la cha√Æne de caract√®res qui lui est pass√©e
  252. --comme argument, entour√©e de quillemets
  253.  
  254. function kwote string
  255. return quote & string & quote
  256. end kwote
  257.  
  258. --la fonction clickLine renvoie le num√©ro de ligne sur laquelle
  259. --le bouton de la souris a √©t√© enfonc√©
  260.  
  261. function clickLine
  262. if style of the target is "scrolling"
  263. then
  264. return ((the mouseV - item 2 of the rect of the target-4 +the scroll of the target) div textheight of the target) + 1
  265. else
  266.   return ((the mouseV - item 2 of rect of the target-4) div textHeight of the target) + 1
  267. end if
  268. end clickLine
  269.  
  270. ‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî*** End of File ***‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî‚Äî
  271.  
  272.